<!DOCTYPE html >
<html lang="zh">
<head>
<title>会员中心</title>
  <{include file="public/header" /}>
  <style>
    .setting{
      position: absolute;
      top: 6px;
      right: 12px;
      width: 25px;
    }
    .setting>a{
      width: 25px;
    }
    .setting>a>img{
      max-width: 100%;
    }

    .clean{
      clear: both;
    }
  </style>
</head>
<body ontouchstart>
<!--主体-->
<div class='weui-content'>
  <div class="wy-center-top">
    <div class="weui-media-box weui-media-box_appmsg">
      <div class="weui-media-box__hd"><img class="weui-media-box__thumb radius user-avatar" src="/static/mall/images/user-default.png" alt=""></div>
      <div class="weui-media-box__bd">
        <h4 class="weui-media-box__title user-name">未知</h4>
        <p class="user-grade">等级：<span class="user-level">未知</span></p>
     <!--   <p class="user-integral">待返还金额：<em class="num">0.0</em>元</p>-->
      </div>
    </div>
    <div class="xx-menu weui-flex">
      <div class="weui-flex__item credit_record"><div class="xx-menu-list"><em class="my_credit">0</em><p>账户余额</p></div></div>
      <div class="weui-flex__item"><div class="xx-menu-list"><em class="my_point">0</em><p>我的积分</p></div></div>
      <div class="weui-flex__item my_goods_favorite" ><div class="xx-menu-list"><em class="my_goods">0</em><p>收藏商品</p></div></div>
    </div>
    <div class="setting">
      <a href="<{:url('setting')}>"><img src="/static/com/img/icon-setting-2.png" class="setting-icon" alt=""></a>
    </div>
    <div class="clean"></div>
  </div>
  <div class="weui-panel weui-panel_access">
    <div class="weui-panel__hd">
      <a href="<{:url('/mall/order/all_orders',['status'=>''])}>" class="weui-cell weui-cell_access center-alloder">
        <div class="weui-cell__bd wy-cell">
          <div class="weui-cell__hd"><img src="/static/mall/images/center-icon-order-all.png" alt="" class="center-list-icon"></div>
          <div class="weui-cell__bd weui-cell_primary"><p class="center-list-txt">全部订单</p></div>
        </div>
        <span class="weui-cell__ft"></span>
      </a>   
    </div>
    <!-- -1-已取消，0-待支付，1-已支付，2-待收货，3-已完，-2-已退款-->
    <div class="weui-panel__bd">
      <div class="weui-flex">
        <div class="weui-flex__item">
          <a href="<{:url('/mall/order/all_orders')}>?status=0" class="center-ordersModule">
            <span class="weui-badge order-count0" style="position: absolute;top:5px;right:10px; font-size:10px;display: none"></span>
            <div class="imgicon"><img src="/static/mall/images/center-icon-order-dfk.png" /></div>
            <div class="name">待付款</div>
          </a>
        </div>
        <div class="weui-flex__item">
          <a href="<{:url('/mall/order/all_orders')}>?status=1" class="center-ordersModule">
            <span class="weui-badge  order-count1" style="position: absolute;top:5px;right:10px; font-size:10px;display: none"></span>
            <div class="imgicon"><img src="/static/mall/images/center-icon-order-dfh.png" /></div>
            <div class="name">待发货</div>
          </a>
        </div>
        <div class="weui-flex__item">
          <a href="<{:url('/mall/order/all_orders')}>?status=2" class="center-ordersModule">
            <span class="weui-badge  order-count2" style="position: absolute;top:5px;right:10px; font-size:10px;display: none"></span>
            <div class="imgicon"><img src="/static/mall/images/center-icon-order-dsh.png" /></div>
            <div class="name">待收货</div>
          </a>
        </div>
        <div class="weui-flex__item">
          <a href="<{:url('/mall/order/all_orders')}>?status=3" class="center-ordersModule">
            <span class="weui-badge order-count3" style="position: absolute;top:5px;right:10px; font-size:10px;display: none"></span>
            <div class="imgicon"><img src="/static/mall/images/center-icon-order-dpj.png" /></div>
            <div class="name">待评价</div>
          </a>
        </div>
      </div>
    </div>
  </div>
  
  <!--<div class="weui-panel weui-panel_access">
    <div class="weui-panel__hd">
      <a href="myburse.html" class="weui-cell weui-cell_access center-alloder">
        <div class="weui-cell__bd wy-cell">
          <div class="weui-cell__hd"><img src="/static/mall/images/center-icon-jk.png" alt="" class="center-list-icon"></div>
          <div class="weui-cell__bd weui-cell_primary"><p class="center-list-txt">我的小金库</p></div>
        </div>
        <span class="weui-cell__ft"></span>
      </a>   
    </div>
    <div class="weui-panel__bd">
      <div class="weui-flex">
        <div class="weui-flex__item">
          <a href="myburse.html" class="center-ordersModule">
            <div class="center-money"><em>0.0</em></div>
            <div class="name">账户总额</div>
          </a>
        </div>
        <div class="weui-flex__item">
          <a href="myburse.html" class="center-ordersModule">
            <div class="center-money"><em>0.0</em></div>
            <div class="name">返现金额</div>
          </a>
        </div>
        <div class="weui-flex__item">
          <a href="myburse.html" class="center-ordersModule">
            <div class="center-money"><em>0.0</em></div>
            <div class="name">待返还</div>
          </a>
        </div>
        <div class="weui-flex__item">
          <a href="myburse.html" class="center-ordersModule">
            <div class="center-money"><em>165</em></div>
            <div class="name">积分</div>
          </a>
        </div>
      </div>
    </div>
  </div>-->
  
  
  <div class="weui-panel">
        <div class="weui-panel__bd">
          <div class="weui-media-box weui-media-box_small-appmsg">
            <div class="weui-cells">
              <a class="weui-cell weui-cell_access" href="<{:url('msg')}>">
                <div class="weui-cell__hd"><img src="/static/com/img/icon-msg-2.png" alt="" class="center-list-icon"></div>
                <div class="weui-cell__bd weui-cell_primary">

                  <p class="center-list-txt">我的消息<span class="weui-badge msg-count" style="position: absolute;right: 28px;display: none"></span></p>
                </div>
                <span class="weui-cell__ft"></span>
              </a>
              <a class="weui-cell weui-cell_access" href="<{:url('record')}>">
                <div class="weui-cell__hd"><img src="/static/mall/images/center-icon-jyjl.png" alt="" class="center-list-icon"></div>
                <div class="weui-cell__bd weui-cell_primary">
                  <p class="center-list-txt">交易记录</p>
                </div>
                <span class="weui-cell__ft"></span>
              </a>
              <a class="weui-cell weui-cell_access" href="<{:url('/mall/goods/my_favorite')}>">
                <div class="weui-cell__hd"><img src="/static/mall/images/center-icon-sc.png" alt="" class="center-list-icon"></div>
                <div class="weui-cell__bd weui-cell_primary">
                  <p class="center-list-txt">我的收藏</p>
                </div>
                <span class="weui-cell__ft"></span>
              </a>
              <a class="weui-cell weui-cell_access" href="<{:url('/mall/user/address_list')}>">
                <div class="weui-cell__hd"><img src="/static/mall/images/center-icon-dz.png" alt="" class="center-list-icon"></div>
                <div class="weui-cell__bd weui-cell_primary">
                  <p class="center-list-txt">地址管理</p>
                </div>
                <span class="weui-cell__ft"></span>
              </a>
              <!--<a class="weui-cell weui-cell_access" href="card.html">
                <div class="weui-cell__hd"><img src="/static/mall/images/center-icon-yhk.png" alt="" class="center-list-icon"></div>
                <div class="weui-cell__bd weui-cell_primary">
                  <p class="center-list-txt">我的银行卡</p>
                </div>
                <span class="weui-cell__ft"></span>
              </a>-->
              <a class="weui-cell weui-cell_access" href="<{:url('/console/account/pwd_change')}>">
                <div class="weui-cell__hd"><img src="/static/mall/images/center-icon-dlmm.png" alt="" class="center-list-icon"></div>
                <div class="weui-cell__bd weui-cell_primary">
                  <p class="center-list-txt">密码修改</p>
                </div>
                <span class="weui-cell__ft"></span>
              </a>
              <a class="weui-cell weui-cell_access" href="javascript:logout()">
                <div class="weui-cell__hd"><img src="/static/mall/images/center-icon-out.png" alt="" class="center-list-icon"></div>
                <div class="weui-cell__bd weui-cell_primary">
                  <p class="center-list-txt">退出账号</p>
                </div>
                <span class="weui-cell__ft"></span>
              </a>
            </div>
          </div>
        </div>
      </div>
  
  
  
</div>

<!--底部导航-->
<{include file="public/footer_nav" /}>

<{include file="public/footer" /}>
<script>
  function logout(){
    $.confirm('确定要退出吗','退出登录状态',function () {
      localStorage.removeItem('user_token');
      location.href  = "<{:url('/console/account/logout')}>";
    })
  }

</script>
<script>

  $(function () {
    $(".my_goods_favorite").on('click',function () {
      location.href = "<{:url('/mall/goods/my_favorite')}>"
    }) ;
    $(".credit_record").on('click',function () {
      location.href = "<{:url('/mall/user/balance')}>"
    })
   //用户信息
    bs_request("<{:url('/mall/user/info')}>", {}, function (res) {
      if (res.code==0){
       $(".user-avatar").attr('src',res.data.user_info.avatar);
       $(".user-level").text(res.data.user_info.level_desc);
       $(".user-name").text(res.data.user_info.nickname);
      }
    });
    $(".user-avatar, .user-name").on('click',function () {
      location.href = "<{:url('update')}>"
    })

  })

  bs_request("<{:url('/mall/user/data_count')}>",{},function (res) {
      if (res.code==0 && res.data.count){
        var count = res.data.count;
        $(".my_credit").text(count.credit.credit)
        $(".my_point").text(count.credit.point)
        $(".my_goods").text(count.goods)
        if (count.msg>0){
          $(".msg-count").show().text(count.msg>=99?'99+':count.msg)
        }

        if (count.order){
          var count_order = count.order;
          if (count_order.count0){
            $(".order-count0").show().text(count_order.count0)
          }else {
            $(".order-count0").hide();
          }
          if (count_order.count1){
            $(".order-count1").show().text(count_order.count1)
          }else {
            $(".order-count1").hide();
          }
          if (count_order.count2){
            $(".order-count2").show().text(count_order.count2)
          }else {
            $(".order-count2").hide();
          }
          if (count_order.count3){
            $(".order-count3").show().text(count_order.count3)
          }else {
            $(".order-count3").hide();
          }
        }
      }
  })
</script>
</body>
</html>
